package com.lansea.wms.model;

import com.lansea.wms.entity.ValidClass;
import com.lansea.wms.model.base.BaseWarehouseAndUser;
import com.lansea.wms.util.DateUtil;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Repository;

import javax.validation.constraints.DecimalMax;
import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.Min;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;
@Data
@Repository
public class Inventory extends BaseWarehouseAndUser {

    @Min(value = 1, message = "id 非法", groups = {ValidClass.EditForm.class})
    private Integer id;

    @Min(value = 1, message = "请选择物料")
    private Integer materialId;

    @DecimalMin(value = "0.01", message = "数量必须大于 0.01")
    @DecimalMax(value = "1000000.00", message = "数量必须小于 1000000")
    private BigDecimal quantity;

    @DateTimeFormat(pattern = DateUtil.DATE_TIME_FORMAT)
    private Date lastInTime;

    @DateTimeFormat(pattern = DateUtil.DATE_TIME_FORMAT)
    private Date lastOutTime;

    private BigDecimal lastInQuantity;
    private BigDecimal lastOutQuantity;


    private String materialCode;
    private String materialName;

    private String mtlUnitName;



}
